<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>查询结果</title>
<link rel="stylesheet" type="text/css" href="bootstrap-responsive.min.css" />
<link rel="stylesheet" type="text/css" href="bootstrap.min.css" />
<script type="text/javascript">
	var v=null;
	function change(obj){
		v=obj.value;
	}
	function sub(){
		frm.action="book.action?type="+v;
		frm.submit();
	}
</script>
</head>
<body>
	<form class="well form-inline" action="login">
			<div id="loginContent">
  			用户名：<input type="text" name="username" class="input-small" placeholder="用户名">
  			密码：<input type="password" name="password" class="input-small" placeholder="密码">
  			<button type="submit" class="btn">登录</button>
  			</div>
	</form>
	<form name="frm" method="post" class="well form-inline">
	<div>
	关键字：<input type="text" name="keyword"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" onclick="sub()" value="查询"/><br/>
	<input type="radio" name="rd" value="byName" onclick="change(this)"><span>按书名查询</span>
	<input type="radio" name="rd" value="byAuthor" onclick="change(this)"><span>按作者查询</span>
	<input type="radio" name="rd" value="byPublish" onclick="change(this)"><span>按出版社查询</span>
	<input type="radio" name="rd" value="byCurrCount" onclick="change(this)"><span>按库存量查询</span>
	</div>
	<table class="table table-striped table-bordered table-condensed">
			<tr>
				<th align="center">图书编号</th>
				<th align="center">图书名称</th>
				<th align="center">图书作者</th>
				<th align="center">图书出版社</th>
				<th align="center">图书ISBN</th>
				<th align="center">图书库存</th>
				<th align="center">图书售价</th>
				<th align="center">图书图片</th>
				<th align="center">操作</th>
			</tr>
		<s:iterator id="book" value="#attr.bookList">
 				<tr>
 					<td align="center">${book.bookId }</td>
 					<td align="center">${book.bookName }</td>
 					<td align="center">${book.bookAuthor }</td>
 					<td align="center">${book.bookPublish }</td>
 					<td align="center">${book.bookISBN }</td>
 					<td align="center">${book.bookCurrCount }</td>
 					<td align="center">${book.bookPrice }</td>
 					<td align="center"><img src="${book.bookPicture }"></td>
 					<td align="center"><a href="queryOnlyBook?bookId=${book.bookId }">编辑</a><a  href="deleteBook?bookId=${book.bookId }">删除</a></td>
 				</tr>
 		</s:iterator>
	</table>
	</form>
</body>
</html>